<template>
  <div class="page-container">
    <aside>
      <div>
        <div v-for="(item, idx) in list" :key="idx">
          <router-link :to="item.path">{{ item.meta.title }}</router-link>
        </div>
      </div>
    </aside>

    <vue-scroll>
      <main>
        <router-view></router-view>
      </main>
    </vue-scroll>
  </div>
</template>

<script>
export default {
  name: 'App',
  computed: {
    list () {
      return this.$router.options.routes
    }
  },
  mounted () {
  }
}
</script>

<style scoped lang="scss">
  .page-container {
    margin: 0 auto;
    width: 1140px;
    height: 100vh;
    display: flex;
  }
  aside {
    width: 200px;
    overflow: auto;
    a {
      color: #333;
      text-decoration: none;
      font-size: 14px;
      display: block;
      padding: 5px 8px;
      &:hover {
        color: #399EE4;
      }
    }
    a.router-link-active {
      color: #399EE4;
    }
  }
  main {
    flex: 1;
    padding: 0 15px;
    overflow: auto;
  }
</style>
